<!-- Phan khai bao bien cuc bo-->

<?php
echo '<div align="center" id="load" style="z-index:1; position:absolute; top:350px; left:500px; display:none"><img src="../../images/load.gif" align="middle"><p class="owner_line1">&#272;ang s&#7855;p x&#7871;p</p></img></div>';
//if (!$is_sort) {
	echo '<div id = "sort_content"><!--dung cho sort (khong duoc xoa hay hieu chinh dong comment nay)-->';
//}
$is_sort = $_REQUEST['is_sort'];
$v_sort_type = $_REQUEST['hdn_sort_type'];
//echo $v_sort_type.'dsfsdfdsf';
$v_move_to_leader_status = $arr_single_recordtype['C_MOVE_TO_LEADER'];
//lay id cua nguoi dang nhap
$v_staff_id =  $_SESSION['staff_id'];
if(isset($_REQUEST['fuseaction_back'])) {
	$fuseaction_back=$_REQUEST['fuseaction_back'];
}else{
	$fuseaction_back = $fuseaction;
}
$v_goto_url = "index.php";
$v_current_style_name = "round_row";
$v_receiver_id = $_SESSION['staff_id'];
$v_recordtype_filter = $_SESSION['onegate_current_recordtype'];
// xac dinh label hien thi: trinh ky, duoc giai quyet, khong duoc giai quyet
$arr_result_label = onegate_get_label_of_result_type($_SESSION['recordtype'],$v_recordtype_filter);
$v_check_recordtype = onegate_get_check_recordtype($_SESSION['recordtype'],$v_recordtype_filter);
$v_count = sizeof($arr_all_record);
$v_delete_record = 0;
//echo onegate_get_handle_agency_id($_SESSION['recordtype'],$v_recordtype_filter);
for($i=0; $i<$v_count; $i++){
	if ($arr_all_record[$i]['FK_RECEIVER'] == $v_receiver_id){
		$v_delete_record = $v_delete_record + 1;
	}
}
// -------nieuvv 210508
$v_status_filter = $_SESSION['onegate_current_status'];
//------------the end nieuvv
?>
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="normal_title">
		<td><?php echo $v_title; ?>
			<a id="goto" href="" style=".color:white">#</a>
		</td>
	</tr>	
</table>
<!-- bang chua cac tieu thuc loc-->
<table cellpadding="0" cellspacing="0" width="100%" border="0">
	<col width="20%"><col width="30%"><col width="50%">
	<!--form chinh-->
		<form action="index.php" name="f_dsp_all_record_search" method="post">
		<input type="hidden" name="fuseaction" value="<?php echo $fuseaction; ?>">
		<input type="hidden" name="fuseaction_back" value="<?php echo $fuseaction_back; ?>">
		<input type="hidden" name="hdn_record_id" value="<?php echo $v_record_id; ?>">
		<input type="hidden" name="hdn_record_id_list" value="">
		<input type="hidden" name="hdn_txt_result" value=""><!--13/06/2008_leav -->
		<input type="hidden" name="hdn_tax_receiver" value=""> <!-- tuyenntt the nguoi nhan thong bao-->
		<input type="hidden" name="hdn_push_receiver" value="">
		<input type="hidden" name="hdn_txt_date_notify_tu_cquan" value="">
		<input type="hidden" name="hdn_receiver_notify_name" value="">
		<input type="hidden" name="hdn_arrange_id" value="">	<!--nieuvv-->
		<input type="hidden" name="hdn_recordtype_status" value="<?php echo $v_status_filter?>">	<!--nieuvv-->
		<input type="hidden" name="hdn_worktype" value="<?php echo $v_worktype; ?>">
		<input type="hidden" name="hdn_recordtype_filter" value="<?php echo $v_recordtype_filter; ?>">
		<input type="hidden" name="hdn_received_date_filter" value="<?php echo $v_receive_date_filter; ?>">
		<!-- DatCQ 14102008 Phan cong thu ly tai tiep nhan. -->
		<input type="hidden" name="hdn_handler" value="<?php echo $v_handler_id; ?>">
		<!-- End 14102008 Phan cong thu ly tai tiep nhan. -->		
		<input type='hidden' name='hdn_page' value='<?php echo $v_page;?>'>
		<input type='hidden' name='hdn_record_number_page' value='<?php echo $v_limit_row;?>'>
		<input type='hidden' name='hdn_tranfered' value='<?php echo $v_tranfered;?>'>	
		<!--[Leav 		-->
		<input type='hidden' name='hdn_v_size' value='<?php echo $v_size;?>'>
		<!--		Leav]-->
		<!--nieuvv--221008--sap xep du lieu-->
		<input type='hidden' name='hdn_id' value='1'>
		<input type='hidden' name='hdn_code' value='1'>
		<input type='hidden' name='hdn_address' value='1'>
		<input type='hidden' name='hdn_name' value='1'>
		<input type='hidden' name='hdn_received' value='1'>
		<input type='hidden' name='hdn_appointed' value='1'>
		<input type='hidden' name='hdn_cmnd' value='1'>
		<!--the-end-nieuvv---->
		<!--vunh--121108--sap xep du lieu-->
		<input type='hidden' name='hdn_sort_type' value='<?php echo $v_sort_type;?>'>
		<!--the-end-vunh---->
	<tr><td height="5"></td></tr>
	<tr>
		<td class="normal_label" align="left"><?php echo CONST_RECORD_TYPE_LABEL;?></td>
		<td colspan="2">
			<select class="normal_selectbox" name="sel_recordtype" style="width:500px" optional="<?php echo CONST_RECORD_TYPE_OPTIONAL; ?>" message = "<?php echo CONST_CATE_MESSAGE; ?>" onChange="document.forms(0).hdn_page.value=1;onchange_submit(this,document.forms[0].hdn_recordtype_filter,'<?php echo $fuseaction;?>');">
			<option id="All" name="All" value="All" selected>-- Tất cả loại hồ sơ --</option>
              <?php echo _generate_select_option($arr_all_recordtype,'0','0','1', $v_recordtype_filter);?>
          </select>
		</td>
	</tr>
	<!-- Nievv 090508---------------------------------------------->
<!--	<tr/>
	<tr>
		<td class="normal_label" align="left"><?php echo CONST_STATUS_TYPE_LABEL;?></td>
		<td colspan="2">
			<select class="normal_selectbox" name="sel_statustype" style="width:200px" 
			optional="<?php echo CONST_STATUS_TYPE_OPTIONAL; ?>" message = "<?php echo CONST_CATE_MESSAGE_STATUS; ?>" onChange="onchange_submit(this,document.forms[0].hdn_recordtype_status,'DISPLAY_ALL_RECEIVED_RECORD_RELAY');">
			<option id="All" name="All" value="All" selected>-- Chọn tình trạng --</option>
              <?php echo _generate_select_option($arr_status_type,'0','0','1', $v_status_filter); ?>
          </select>
		</td>
	</tr>
	<!------------------------------------------------------->
	<?php 
			if ($_ISA_CURRENT_MODUL_CODE == "HANDLE" || $_ISA_CURRENT_MODUL_CODE == "APPROVING" || $_ISA_CURRENT_MODUL_CODE == "RECEIVE_RESULT" ) {
					//DatCQ: Phan biet tim kiem ben thu ly va phe duyet 160908
					$v_report_xml_file = "tim_kiem_ho_so_tiep_nhan.xml";//nieuvv--160908---
					//if($_ISA_CURRENT_MODUL_CODE == "HANDLE")
					//$v_report_xml_file = "tim_kiem_ho_so_tiep_nhan.xml";
					if($_ISA_CURRENT_MODUL_CODE == "APPROVING")
						$v_report_xml_file = "tim_kiem_ho_so_phe_duyet.xml";
					//if($_ISA_CURRENT_MODUL_CODE == "RECEIVE_RESULT")	
					//	$v_report_xml_file = "tim_kiem_ho_so_tiep_nhan.xml";										
					//End: Phan biet tim kiem ben thu ly va phe duyet
					$v_report_xml_file = "../../xml/search/".$v_report_xml_file;
					if (!is_file($v_report_xml_file)){
						$v_report_xml_file = "../../xml/search/tim_kiem_ho_so.xml";
					}
					//echo $v_report_xml_file;
					
					$v_report_xml_string = _read_file($v_report_xml_file);
					$table_struct_rax = new RAX(); 
					$table_struct_rec = new RAX(); 
					$table_struct_rax->open($v_report_xml_string);
					$table_struct_rax->record_delim = 'table_struct_of_filter_form';
					$table_struct_rax->parse();
					$table_struct_rec = $table_struct_rax->readRecord(); 
					$table_struct_row = $table_struct_rec->getRow();
					$v_form_title = $table_struct_row["form_title"];
					$v_first_col_width = $table_struct_row["first_col_width"];
					$v_second_col_width = (100-$v_first_col_width)."%";
					///Begin//Form
					$v_html_string = '';
					//$v_html_string = $v_html_string . "<div style='border:solid 1px #66CCFF'>";//////
					//Bat dau bang chua tat ca cac thanh phan cua form
					$v_html_string = $v_html_string . "<table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td>";
					//Bang chua cac dong cua form
					$v_html_string = $v_html_string . "<table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td> ";
					///Begin///Bang chua cac dong co dinh cua ho so
					$v_html_string = $v_html_string . "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
					$v_html_string = $v_html_string . "<col width='15%'><col width='85%'>";				
					$v_html_string = $v_html_string . "</table>";
					///End///Bang chua cac dong co dinh cua ho so
					//Doc cac dong cua form						
					$table_struct_rax = new RAX(); 
					$table_struct_rec = new RAX(); 
					$table_struct_rax->open($v_report_xml_string);
					$table_struct_rax->record_delim = 'row';
					$table_struct_rax->parse();
					$table_struct_rec = $table_struct_rax->readRecord(); 
					//echo htmlspecialchars($v_xml_str);
					$v_html_string = $v_html_string ."<br>";
					$v_html_string = $v_html_string . "<div  class='large_link' style='border:solid 1px #CCCCCC;width:100%'>";//nieuvv-131008--dong khung phan tim kiem
					while ($table_struct_rec) { 
						$table_struct_row = $table_struct_rec->getRow();
						$v_have_line_before = $table_struct_row["have_line_before"];
						$v_col_number = $table_struct_row["col_number"];
						$v_tag_list = $table_struct_row["tag_list"];
						$v_row_id = $table_struct_row["row_id"];
						$arr_tag = explode(",", $v_tag_list);
						//13102008
						if(!in_array($v_recordtype_filter,array('010','027','035','036','037','038','039','040','041'))){
							$v_arr_temp=array();
							for($i=0;$i<sizeof($arr_tag);$i++){
								if($arr_tag[$i]!='ben_a' && $arr_tag[$i]!='ben_b'){
								$v_arr_temp[$i]=$arr_tag[$i];
								}
							}
							$arr_tag=$v_arr_temp;
						}else{
							$v_arr_temp=array();
							for($i=0;$i<sizeof($arr_tag);$i++){
								if($arr_tag[$i]!='ho_ten'){
									$v_arr_temp[$i]=$arr_tag[$i];
								}
							}
							$arr_tag=$v_arr_temp;
						}
						//13102008_end---------------------------
						if ($v_have_line_before=="true"){
							$v_html_string = $v_html_string . "<table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr>";
							$v_html_string = $v_html_string . "<td><hr width='100%' color='#66CCFF' size='1'></td>";
							$v_html_string = $v_html_string . "</tr></table>";
						}
						//Bang chua mot dong cua form
						//$v_html_string = $v_html_string . "<div style='border:solid 1px #66CCFF'>";
						$v_html_string = $v_html_string . "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
						$v_html_table = "";
						$v_html_tag = "";
						for($i=0;$i < sizeof($arr_tag);$i++){
							$formfield_rax = new RAX(); 
							$formfield_rec = new RAX(); 
							$formfield_rax->open($v_report_xml_string);
							$formfield_rax->record_delim = $arr_tag[$i];							
							$formfield_rax->parse();
							$formfield_rec = $formfield_rax->readRecord(); 
							$formfield_row = $formfield_rec->getRow(); 
							$v_label = $formfield_row["label"];
							$v_type = $formfield_row["type"];
							$v_dataformat = $formfield_row["data_format"];
							$v_width = $formfield_row["width"];
							$v_row = $formfield_row["row"];
							$v_max = $formfield_row["max"];
							$v_min = $formfield_row["min"];
							$v_maxlength = $formfield_row["maxlength"];
							$v_note = $formfield_row["note"];
							$v_message = $formfield_row["message"];
							$v_optional = $formfield_row["optional"];
							$v_xml_tag_in_db = $formfield_row["xml_tag_in_db"];
							$v_js_function_list = $formfield_row["js_function_list"];
							$v_js_action_list = $formfield_row["js_action_list"];
							$v_readonly_in_edit_mode = $formfield_row["readonly_in_edit_mode"];
							$v_disabled_in_edit_mode = $formfield_row["disabled_in_edit_mode"];						
							if ($v_xml_str!=""){
								$column_rax = new RAX();
								$column_rec = new RAX();
								$column_rax->open($v_xml_str);									
								$column_rax->record_delim = 'data_list';
								$column_rax->parse();
								$column_rec = $column_rax->readRecord(); 
								$column_row = $column_rec->getRow();								
								$v_value = _restore_XML_bad_char($column_row[$v_xml_tag_in_db]); 
							}
							if ($v_type=="selectbox"){
								$v_selectbox_option_sql = $formfield_row["selectbox_option_sql"];
								$v_selectbox_id_column = $formfield_row["selectbox_option_id_column"];
								$v_selectbox_name_column = $formfield_row["selectbox_option_name_column"];
							}
							if ($v_type=="checkboxmultiple"){
								$v_checkbox_multiple_sql = $formfield_row["checkbox_multiple_sql"];
								$v_checkbox_multiple_id_column = $formfield_row["checkbox_multiple_id_column"];
								$v_checkbox_multiple_name_column = $formfield_row["checkbox_multiple_name_column"];
							}
							$v_html_table = $v_html_table . "<col width='$v_first_col_width'>" . "<col width='$v_second_col_width'>";							
							$v_html_tag = $v_html_tag . Generate_HTML_Input();								
						}
						$v_html_string = $v_html_string .  $v_html_table . "<tr id = '$v_row_id' style='display:block'>" . "<td class='normal_label'>" . $v_html_tag."</td>";
						$v_html_string = $v_html_string . "</tr></table>";					
						$table_struct_rec = $table_struct_rax->readRecord();						
						//print_r($table_struct_rec); echo '</br>';
					}
					$v_html_string = $v_html_string . "</td></tr></table>";
					//$v_html_string = $v_html_string ."</div>";
					//End//Bang chua cac thanh phan cua form
					echo $v_html_string; ?>
					
			<?php } 
			else { ?>		
				</tr>
			<?php } 
			$v_html_string = $v_html_string ."</div>";//the-end-nieuvv-131008--
			?>
	<?php
//	echo $v_recordtype_filter; 
	if ($v_show_date){?>
	<tr>
		<td align="left" class="normal_label"><?php echo CONST_RECORD_DATE_FILTER_LABEL;?>
		</td>
		<td>
			<input type="text" name="txt_received_date" class="normal_date_textbox" isdate = "true" optional="<?php echo CONST_RECORD_DATE_FILTER_OPTIONAL; ?>" message = "<?php echo CONST_RECORD_DATE_FILTER_MESSAGE; ?>" value="<?php echo $v_receive_date_filter; ?>" onKeyDown="txt_filter_keydown();change_focus(document.forms[0],this);">
			<img src="<? echo $_ISA_IMAGE_URL_PATH;?>calendar.gif" border="0" onclick="DoCal('<?php echo $_ISA_LIB_URL_PATH; ?>isa-calendar/',document.forms[0].txt_received_date);onchange_submit(document.forms[0].txt_received_date,document.forms[0].hdn_received_date_filter,'DISPLAY_ALL_RECORD');" style="cursor:hand;">
			<input type="hidden" name="123" class="normal_date_textbox" onClick="onchange_submit(document.forms[0].txt_received_date,document.forms[0].hdn_received_date_filter,'<?php echo $fuseaction;?>');">
		</td>		
	</tr><?php
	}?>		
</table>
<!--
	Doan ma nay dung de hien thi cac duong link tuong ung voi cac nut o duoi man hinh danh sach
	Vi du: duong link "Them" tuong ung voi nut "Them" o duoi
-->
<!--Table chua cac button-->
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
	<tr><td height="5pt"></td></tr><?php
	if ($v_worktype=="TIEP_NHAN"){?>
	<tr align="left">
		<td align="left" class="large_link" colspan="3"><?php 
			if ((($v_is_granted_update)|| (onegate_is_receiver_for_recordtype($v_receiver_id,0,$_SESSION["recordtype"])))&&$v_recordtype_filter!="All" ){ ?>
				<a href="#" name="btn_add" onclick="btn_add_onclick(document.forms[0].hdn_record_id, 'DISPLAY_SINGLE_RECORD');"><?php echo _CONST_ADD_BUTTON; ?></a>&nbsp;|<?php
			}
			if ($v_count>0)
			{
				if (($v_check_recordtype)  && (!$v_move_to_leader_status)) {?>
					<a  href="#" name="btn_move_to_result" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT');"><?php echo CONST_RECORD_RECEIPTED_PRINT_BUTTON; ?></a>&nbsp;|
					<a href="#" name="btn_move_to_result_label" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT_LABEL');"><?php echo CONST_RECORD_RECEIPTED_LABEL_PRINT_BUTTON; ?></a>&nbsp;|<?php
				}?>
				<!-- DatCQ 14102008 Phan cong thu ly tai tiep nhan. -->
				<a href="#" name="btn_receipted_hand" onclick="show_modal_dialog_update_onclickDatCQ('record/receive/index.php','DISPLAY_RECORD_HANDOVER','UPDATE_RECORD_HANDOVER',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_handler,document.forms[0].hdn_record_number_page);"><?php echo CONST_RECORD_RECEIPTED_HAND_BUTTON; ?></a>&nbsp;|
				
			<?php	
				if (($v_check_recordtype) && (!$v_move_to_leader_status)) {?>
					<a href="#" name="btn_record_to_check_print" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_HANDOVER');"><?php echo CONST_RECORD_TO_CHECK_PRINT_BUTTON; ?></a>&nbsp;|<?php
				}
				if($v_move_to_leader_status){?>				
						<a href="#" name="btn_move_to_result" onclick="show_modal_dialog_update_onclick('record/receive/index.php','DISPLAY_LIST_RECORD_MOVE_TO_RESULT','UPDATE_RECORD_LIST_CHECKED',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter);"><?php echo _CONST_MOVE_TO_LEADER; ?></a>&nbsp;|
				<?php }
				if($v_recordtype_filter == "030" || $v_recordtype_filter == "032")
				{?>
					<a href="#" name="btn_move" onclick="btn_move_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'UPDATE_LUANCHUYEN_HANDOVER','LUAN_CHUYEN');"><?php echo _CONST_MOVE_LABEL; ?></a>&nbsp;|
				<?php 
				}				
				if (($v_is_granted_update) || ($v_delete_record > 0) )
				{?>
					<a href="#" name="btn_delete" onclick="btn_delete_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DELETE_RECORD');"><?php echo _CONST_DELETE_BUTTON; ?></a>&nbsp;<?php					
				}
			}?>
		<!-- Button ky nhan Danh Sach Ho So Da Tiep Nhan-->
 		<!--a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick (document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_KYNHAN_RECORD');"><?php echo _CONST_KYNHAN_BUTTON; ?></a-->&nbsp;
		</td>
	</tr><?php
	}
	
	
	elseif($v_worktype=="TRINH_KY" && _CONST_ALLOW_HANDLER_UPDATING_APPROVING){?>
	<tr align="left">
		<td align="left" class="large_link" colspan="3"><?php
			if($fuseaction=="DISPLAY_ALL_RECORD_FOR_APPROVING" && $v_count>0){?>
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Cho Duyet (Phe Duyet)-->	
				<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick( document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_PD_HSTK');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;|	<?php } 
			if($fuseaction=="DISPLAY_ALL_WATING_NOTIFY_PUNISH" && $v_count>0){	?>
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Phe Duyet Thong Bao Phat (Phe Duyet)-->	
				<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick( document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_PD_TBP');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;|	<?php } 
			if($fuseaction=="DISPLAY_ALL_WATING_NOTIFY_TAX" && $v_count>0){	?>
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Phe Duyet Thong Bao Thue (Phe Duyet)-->	
				<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick( document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_PD_TBT');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;|	<?php } 
			// End ----------------------------------------
			if (($_ISA_CURRENT_MODUL_CODE== "HANDLE") && (onegate_is_handler_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"])==true)&&($v_count>0)){?>
				<input type="hidden" name="hdn_approve_by_handler" value="<?php echo true ?>">
				<a href="#" name="btn_result_handle" onclick="btn_result_handle_onclick_hieudt(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_ALL_HANDLE_RECORD_FOR_UPDATE_STATUS');"><?php echo CONST_RESULT_APPROVING_RECORD_BUTTON; ?></a>&nbsp;|<?php 
			}
			//Leav_update_06/06/2008 :them dkien ($v_show_link_result==true)
			if (($_ISA_CURRENT_MODUL_CODE== "APPROVING")&&($v_count>0)&& ($v_show_link_result==true)){?>
				<input type="hidden" name="hdn_approve_by_handler" value="<?php echo true ?>">
				<a href="#" name="btn_result_handle" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'<?php echo $v_temp_le;?>');"><?php echo CONST_UPDATE_APPROVING_STATUS_BUTTON; ?></a>&nbsp;|   <!----nieuvv--120808--- -->
			<!--[Leav_begin 13h43,05/06/2008 Them link THONG_BAO ben phia trinh duyet---------------------------->
	        <?php  }
		  	$sql = "Exec Onegate_RecordWorkSingleByRecordtype_leav  ";
			$sql = $sql ."'" . $v_recordtype_filter . "'";
			$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
			$result = $ado_conn->GetAll($sql);
			$v_size=sizeof($result);
			
		  	if ($v_size >=1 && $v_count>0 && ($fuseaction=="DISPLAY_ALL_WATING_NOTIFY_TAX"||$fuseaction=="DISPLAY_ALL_WATING_NOTIFY_PUNISH" || $fuseaction=='DISPLAY_ALL_WATING_NO_NOTIFY_PUBNISH')){
			////Leav_18092008
				if(is_contain_config($v_c_system_conf,'TRINH_LDLC_TP')&& !is_leader_last($_SESSION['staff_id'],$v_arrs_leader_last_approve) &&($fuseaction=="DISPLAY_ALL_WATING_NOTIFY_PUNISH" || $fuseaction=='DISPLAY_ALL_WATING_NO_NOTIFY_PUBNISH')){
					$v_fuseaction_href="DISPLAY_NOTIFY_2";
				}
				//Leav_18092008_end
			
			?>
		   		<a href="#" name="btn_result_handle" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'<?php echo $v_fuseaction_href;?>');"><?php echo CONST_UPDATE_APPROVING_STATUS_BUTTON; ?></a>
		   <?php }?>
<!-- [Leav_begin 13h43,05/06/2008 ket thuc them link THONG_BAO ben phia trinh duyet---------------------------->
		</td>
	</tr><?php	//Leav_update 24/05/2008
	}elseif (($v_worktype=="THU_LY" || $v_worktype=="NHAN_HO_SO_BO_SUNG" || $v_worktype=="CHUYEN_HOSO_CQTQ"||$v_worktype=="DANH_SACH_HS_THONG_BAO_THUE"||$v_worktype=="DANH_SACH_HS_THONG_BAO_PHAT")&&($v_count>0)){?>
	<tr align="left">
		<td align="left" colspan="3" class="large_link">
		<!-- [Leav_begin 16h43,21/05/2008 Them link Noi dung thong bao ben DSHS --------------------------->
		
			<?php if($v_worktype=="DANH_SACH_HS_THONG_BAO_PHAT"){?>
			<a href="#" name="btn_rate" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK_LEAV_PHAT');"><?php echo CONST_RATE_BUTTON; ?></a>&nbsp;|
			
			<?php }elseif($v_worktype=="DANH_SACH_HS_THONG_BAO_THUE"){?>
			<a href="#" name="btn_rate" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK_LEAV_THUE');"><?php echo CONST_RATE_BUTTON; ?></a>&nbsp;|
			<?php }else{ ?>
			<!-- modified by kien-->
			<a href="#" name="btn_rate" onclick="btn_result_handle_onclick_kienlt(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK');"><?php echo CONST_RATE_BUTTON; ?></a>&nbsp;|
			<!-- kien_upadate_end:04082008-->
			<?php } ?>
		<!-- Leav_end 16h43,21/05/2008--------------------------------------------------------------------------->
			
			<a href="#" name="btn_result_handle_onclick" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_IDEA');"><?php echo CONST_IDEA_BUTTON; ?></a>&nbsp;|
			<a href="#" name="btn_opinion" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_DOC');"><?php echo CONST_OPINION_BUTTON; ?></a>&nbsp;|
						
			<?php if($v_worktype=="DANH_SACH_HS_THONG_BAO_PHAT"||$v_worktype=="DANH_SACH_HS_THONG_BAO_THUE"){
				if($v_worktype=="DANH_SACH_HS_THONG_BAO_PHAT"){
			?>
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Thong Bao Phat (Thu Ly)-->
 			<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick (document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_TBP');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;|
			<!-- [LeAV :Them line THONG BAO-->
			<?php }
				else {
			?>
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Thong Bao Thue (Thu Ly)-->
 			<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick (document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_TBT');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;|
			<!-- [LeAV :Them line THONG BAO-->
			<?php }
				}//&& $fuseaction!='DISPLAY_ALL_HANDLING_RECORD'
           if ($v_size >=1 && $v_worktype=="THU_LY"&&$_ISA_CURRENT_MODUL_CODE=='HANDLE'){ ?><!-- hdn_record_id: là các id_record da đc check-->
                <a href="#" name="btn_result_handle_leav" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_NOTIFY');"><?php echo CONST_NOTIFY_THUE; ?></a>
           <!-- LeAV]-->
		   <!-- [Leav_begin 11h43,21/05/2008 Them link Noi dung thong bao ben DSHS thong bao.----------------------------------------------->
			&nbsp;|<?php }
           if ($v_size >=1 && $v_worktype=="DANH_SACH_HS_THONG_BAO_THUE"){?><!-- hdn_record_id: là các id_record da đc check-->
                <a href="#" name="btn_result_handle_leav" onclick="btn_result_handle_onclick_leav(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_SINGLE_NOTIFY_TAX_CONTENT');"><?php echo CONST_CONTENT_NOTIFY_THUE; ?></a>&nbsp;|
			<?php }
           if ($v_size >=1 && $v_worktype=="DANH_SACH_HS_THONG_BAO_PHAT"){?><!-- hdn_record_id: là các id_record da đc check-->
                <a href="#" name="btn_result_handle_leav" onclick="btn_result_handle_onclick_leav(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_SINGLE_NOTIFY_PUNISH_CONTENT');"><?php echo CONST_CONTENT_NOTIFY_PHAT; ?></a>&nbsp;|
           <!-- Leav_end....11h43,21/05/2008------------------------------------------------------------------------->
			<?php }

			if (($_ISA_CURRENT_MODUL_CODE== "HANDLE") && (onegate_is_handler_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"])==true)&&$v_recordtype_filter!="All"
            && !in_array($v_worktype,array('DANH_SACH_HS_THONG_BAO_THUE','DANH_SACH_HS_THONG_BAO_PHAT'))
            ){?>
				<a href="#" name="btn_result_handle" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_ALL_HANDLE_RECORD_FOR_UPDATE_STATUS');"><?php echo CONST_RESULT_HANDLE_RECORD_BUTTON; ?></a>&nbsp;|
		<?php 
			}
			if ($v_worktype=="NHAN_HO_SO_BO_SUNG" && $_ISA_CURRENT_MODUL_CODE == "RECEIVE_RESULT"){?>
				<!-- Gui mail thong bao -->
				<a href="#" name="btn_send_mail" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_MULTIPLE_RECORD_FOR_SEND_MAIL');"><?php echo _CONST_SEND_EMAIL_BUTTON; ?></a>&nbsp;|
				
				<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Cho Bo Sung (TN TKQ)-->
 				<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TN_CBS');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;
				<?php
			}
			
			if (onegate_is_doc_with_multi_object_for_recordtype($v_recordtype_filter,$_SESSION['recordtype'])){?>
				<a href="#" name="btn_update_license" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_MULTIPLE_LICENSE');"><?php echo $arr_result_label[3]; ?></a>&nbsp;|
				<?php				
			}
			if ($_ISA_CURRENT_MODUL_CODE== "RECEIVE_RESULT" && $v_worktype=="THU_LY" && $v_fuseaction_onclick != "DISPLAY_ALL_RECORD_WORK_VUNH"){?>
				<a href="#" name="btn_result" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_HANDOVER');"><?php echo CONST_RECORD_RECEIPTED_FORWORD_BUTTON; ?></a>&nbsp;|
				<?php
			}
			//nut in phieu trinh ky
			if ($_ISA_CURRENT_MODUL_CODE== "HANDLE" && $v_worktype=="THU_LY" && ($v_check_recordtype)){?>
				<a href="#" name="btn_hande" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_TO_SUBMIT');"><?php echo CONST_PRINT_TO_SUBMIT; ?></a>&nbsp;|
				
				<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Dang Thu Ly (Thu Ly)-->
				<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_HSDTL');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;		
				<?php }?>
		</td>
	</tr>	
	<!-- Leav_begin_17112008 -->
	<?php 
	}elseif(($v_worktype=="NOTIFY_TAX_TU_CQUAN")&&($v_count>0)){?>
	<tr align="right">
		<td align="left" colspan="3" class="large_link">
		
		<a href="#" name="btn_rate" onclick="show_modal_dialog_update_onclick_nhan_blai_tu_cquan('record/receive/index.php','RECEIVE_BLAI_THUE_TU_CQUAN','UPDATE_RECEIVE_BLAI_THUE_TU_CQUAN',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_txt_result);"><?php echo CONST_RECEIVE_NOTIFY_FROM_CQUAN; ?></a>&nbsp;|
		 <a  href="#" name="btn_move_to_result" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT');"><?php echo  CONST_RECORD_RECEIPTED_PRINT_BUTTON; ?> </a>&nbsp;|
		 <a href="#" name="btn_rate" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK_VUNH');"><?php echo CONST_TIEN_DO; ?></a> &nbsp;|
		 <a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TN_TBT');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>
		</td>
	</tr>
	<!-- Leav_end_17112008 -->
	<?php 
	}elseif(($v_worktype=="NOTIFY_TAX")&&($v_count>0)){?>
	<tr align="right">
		<td align="left" colspan="3" class="large_link">
		<!--Leav_begin_update_16 h 12,11/06/2008 ->continue_begin :13/06/2008
		*Ở giai đoạn TN&TKQ:Hồ sơ thông báo thuế
		-->
		<!--Leav Update 16102008_begin :khong hien thi Link (Nhan bien lai thue tu co quan thue) :track #99-->
		   <a style="display:none" href="#" name="btn_rate" onclick="show_modal_dialog_update_onclick_nhan_blai_tu_cquan('record/receive/index.php','RECEIVE_BLAI_THUE_TU_CQUAN','UPDATE_RECEIVE_BLAI_THUE_TU_CQUAN',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_txt_result);"><?php echo CONST_RECEIVE_NOTIFY_FROM_CQUAN; ?></a>
		   <!--Leav Update 16102008_end) -->
		 <a  href="#" name="btn_move_to_result" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT');"><?php echo  CONST_RECORD_RECEIPTED_PRINT_BUTTON; ?> </a>&nbsp;|
		 <!--Link :Thông báo ,da xử lý :CONST_NOTIFY_THUE-->
			<a href="#" name="btn_receipted_hand" onclick="show_modal_dialog_update_onclick_tax_2('record/receive/index.php','DISPLAY_RECORD_HANDOVER_THUE','UPDATE_RECORD_HANDOVER_THUE',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_tax_receiver,document.forms[0].hdn_txt_result,document.forms[0].hdn_txt_date_notify_tu_cquan,document.forms[0].hdn_receiver_notify_name);"><?php echo CONST_NOTIFY_TAX_LINK; ?></a>&nbsp;|
			<a href="#" name="btn_rate" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK_VUNH');"><?php echo CONST_TIEN_DO; ?></a> &nbsp;|
		<!--Leav_end_update_16 h 12,11/06/2008->continue_end :13/06/2008 -->

			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Thong Bao Thue (TN TKQ)-->
			<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TN_TBT');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;		
		</td>
	</tr><?php 
	}elseif(($v_worktype=="NOTIFY_PHAT")&&($v_count>0)){?>
	<tr align="right" >
		<td align="left" colspan="3" class="large_link">
		<!--
			<a href="#" name="btn_result_handle_leav" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_NOTIFY_PHAT');"><?php echo CONST_NOTIFY_THUE; ?></a>&nbsp;| -->
			<a href="#" name="btn_rate" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK_VUNH');"><?php echo CONST_TIEN_DO; ?></a>&nbsp;|
			<a  href="#" name="btn_move_to_result" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT');"><?php echo CONST_RECORD_RECEIPTED_PRINT_BUTTON; ?>&nbsp;|
			<a href="#" name="btn_receipted_hand" onclick="show_modal_dialog_update_onclick_tax('record/receive/index.php','DISPLAY_RECORD_HANDOVER_PHAT','UPDATE_RECORD_HANDOVER_PHAT',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_tax_receiver,document.forms[0].hdn_txt_result);"><?php echo CONST_NOTIFY_PUNISH_LINK; ?></a>&nbsp;|
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Thong Bao Phat (TN TKQ)-->
			<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TN_TBP');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;	
		</td>
	</tr>	
	
	<?php //Leav_begin_update:14/06/2008 
	}elseif(($v_worktype=="DANH_SACH_HS_DA_NOP_THUE"||$v_worktype=="DANH_SACH_HS_DA_NOP_PHAT")&&($v_count>0)){?>
		<?php if($v_worktype=="DANH_SACH_HS_DA_NOP_THUE"){
					$v_update="UPDATE_RECORD_HANDOVER_BANGIAO_THUE";
			}else{
				$v_update="UPDATE_RECORD_HANDOVER_BANGIAO_PHAT";
			}
		?>
	<tr align="right" >
		<td align="left" colspan="3" class="large_link">
		<a  href="#" name="btn_move_to_result" onclick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT');"><?php echo CONST_RECORD_RECEIPTED_PRINT_BUTTON; ?></a>&nbsp;|
		<a href="#" name="btn_receipted_hand" onclick="show_modal_dialog_update_onclick('record/receive/index.php','DISPLAY_RECORD_HANDOVER','<?php echo $v_update;?>',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter);"><?php echo CONST_RECORD_RECEIPTED_HAND_BUTTON; ?></a>&nbsp;|
		<a href="#" name="btn_rate" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK_VUNH');"><?php echo CONST_RATE_BUTTON; ?>
		</td>
	</tr>	
	<? //Leav_end_update:14/06/2008 ?>
	<?php 
	}elseif (($v_worktype=="PHAN_CONG")&&($v_count>0) ){?>
	<tr align="right">
		<td align="left" colspan="3" class="large_link">			
			<a href="#" name="btn_sharing" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_SHARING_RECORD');"><?php echo CONST_SHARING_RECORD_BUTTON; ?></a>&nbsp;|
		</td>
	</tr><?php	
	}elseif (($v_worktype=="THAY_DOI_NGUOI_THU_LY")&&($v_count>0) ){?>
	<tr align="right">
		<td align="left" colspan="3" class="large_link">			
			<a href="#" name="btn_sharing_change" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_SHARING_RECORD');"><?php echo CONST_SHARING_RECORD_CHANGLE_BUTTON; ?></a>&nbsp;|
		</td>
	</tr><?php	
	}elseif(($v_worktype=="CAP_PHEP" || $v_worktype=="TRINH_KY")&&($v_count>0) && onegate_is_doc_with_multi_object_for_recordtype($v_recordtype_filter,$_SESSION['recordtype'])){?>
	<tr align="right">
		<td align="right" colspan="3" class="large_link">			
			<a href="#" name="btn_sharing_change" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_MULTIPLE_LICENSE');"><?php echo $arr_result_label[3]; ?></a>&nbsp;|
			
		</td>
	</tr><?php
	}elseif (($v_count>0) && ($v_worktype=="TRA_KET_QUA")){?>
	<tr align="right">
		<td align="left" colspan="3" class="large_link">			
			<a href="#" name="btn_result" onclick="btn_result_update_onclick('DISPLAY_SINGLE_LICENCE_RECORD',document.forms(0).chk_item_id,document.forms(0).hdn_record_id);"><?php echo CONST_RESULT_BUTTON; ?></a>&nbsp;|
			<a href="#" name="btn_send_mail" onclick="btn_result_handle_onclick(document.forms(0).chk_item_id,document.forms(0).hdn_record_id_list,'DISPLAY_MULTIPLE_RECORD_FOR_SEND_MAIL');"><?php echo _CONST_SEND_EMAIL_BUTTON; ?></a>&nbsp;|
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Tra Ket Qua (TN TKQ)-->	
			<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick( document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_KQ_HSTKQ');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;
		</td>
	</tr><?php 
	}elseif (($v_count>0) && ($v_worktype=="CAP_PHEP")){?> 
	<tr align="left">
		<td align="left" colspan="3" class="large_link">			
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Da Giai Quyet (Thu Ly)-->	
			<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_HSDGQ');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>|
		<!-- nieuvv--150908--them link: Noi dung giay phep o Danh Sach ho so da giai quyet --> 
		<?php 
			if($_work_leav !=1001 && $_work_leav !=1000  && $_SESSION['onegate_current_recordtype'] != "All"){
		?>		
			<!-- DatCQ Button Noi Dung Giay Phep 311008-->
			<a href="#" name="btn_update_license" onclick="btn_result_handle_onclick(document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SINGLE_LICENSE', document.forms[0].hdn_recordtype_filter);"><?php echo $arr_result_label[3]; ?></a>&nbsp;
		</td>
		<?php } ?>
		<!-- the end nieuvv--150908--->
	</tr><?php
	}elseif (($v_count>0) && ($v_worktype=="CHUYEN_HOSO_CQTQ")){?> 
	<tr align="right">
		<td align="right" colspan="3" class="large_link">			
			<!--DatCQ: 100608 Button ky nhan Danh Sach Ho So Da Chuyen Cap Co Tham Quyen Giai Quyet (Thu Ly)-->	
			<a href="#" name="btn_result_handle_chuong" onclick="btn_result_handle_onclick (document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_HSDCC');"><?php echo _CONST_KYNHAN_BUTTON; ?></a>&nbsp;
		</td>
	</tr><?php
	
	}?>
</table>
<!--Het phan dia chi link-->

<!--Bat dau cong xau html de in danh sach du lieu-->
<?php
if (is_null($v_xml_file_list) || $v_xml_file_list==""){
	$v_file_list = "danh_sach_ho_so_da_tiep_nhan.xml";
}else{
	$v_file_list = $v_xml_file_list;
}
//file dinh dang bang hien thi danh sach ho so da tiep nhan
$v_table_struct_xml_file = "../../xml/".$v_recordtype_filter."/".$v_file_list;
if (file_exists($v_table_struct_xml_file)){
	$v_table_struct_xml_string = _read_file($v_table_struct_xml_file);
	
}else{
	$v_table_struct_xml_file = "../../xml/other/".$v_file_list;
	$v_table_struct_xml_string = _read_file($v_table_struct_xml_file);
}
/////nieuvv--301008---dem so cot////////////////////////////
$table_struct_rax = new RAX(); 
$table_struct_rec = new RAX(); 
$table_struct_rax->open($v_table_struct_xml_string);
$table_struct_rax->record_delim = 'col';
$table_struct_rax->parse();
$table_struct_rec = $table_struct_rax->readRecord(); 
$v_column = 0;
while($table_struct_rec )
{
	$xml_data =  $table_struct_row['xml_data'];
	$column_name = $table_struct_row['column_name'];
	$xml_tag_in_data = $table_struct_row['xml_tag_in_db'];	
	$v_label = $table_struct_row["label"];
	$v_width = $table_struct_row["width"];
	$table_struct_rec = $table_struct_rax->readRecord();
	$v_column ++;
}
///////the-end-nieuvv-301008--//////////////////////////
//echo $v_table_struct_xml_file;
$table_struct_rax = new RAX(); 
$table_struct_rec = new RAX(); 
$table_struct_rax->open($v_table_struct_xml_string);
$table_struct_rax->record_delim = 'col';
$table_struct_rax->parse();
$table_struct_rec = $table_struct_rax->readRecord(); 
$v_html_string = '';
$v_html_string = $v_html_string  . '<form action="index.php" method="post" name="f_dsp_all_record">';
$v_html_string = $v_html_string  . '<table class="list_table2" width="100%" cellpadding="0" cellspacing="0">';
$v_html_temp_width = '';
$v_html_temp_label = '';
//$v_column = 0;
/************* modified by tuyenntt             *********************/
/************* Them link sap xep theo label cot *********************/
/************* modified date 16/10/2008         *********************/
$v_id = 0;
if ($v_sort_type == 'desc') {
	$v_sort_type = 'asc';		
} 
else {
	$v_sort_type = 'desc';		
}
//echo $v_sort_type.'11111';
while ($table_struct_rec) { 
	$table_struct_row = $table_struct_rec->getRow();
	//tieu chi sap xep	
	$xml_data =  $table_struct_row['xml_data'];
	$column_name = $table_struct_row['column_name'];
	$xml_tag_in_data = $table_struct_row['xml_tag_in_db'];	
	$v_label = $table_struct_row["label"];
	$v_width = $table_struct_row["width"];
	$v_html_temp_width = $v_html_temp_width  . '<col width="'.$v_width .'">';
	//$v_html_temp_label = $v_html_temp_label . '<td align="center" title = "Sắp xếp" onclick="Arange('.$v_id.','.$v_total_record.','.$v_column.'); ">';	
	$v_image = '';
	if (($_REQUEST['xml_tag_in_data'] == $xml_tag_in_data && $xml_data == 'true') || ($_REQUEST['column_name'] == $column_name && $xml_data == 'false')) {
		if ($v_sort_type == 'desc') {
			$v_image = '<img src="../../images/asc.gif"></img>';
		} else {
			$v_image = '<img src="../../images/desc.gif"></img>';
		}
	}
	$v_html_temp_label = $v_html_temp_label . '<td style="CURSOR: hand" align="center" title = "Sắp xếp" onclick="arrange_list(\''.$column_name.'\',\''.
		              $xml_tag_in_data.'\',\''.  
		              $xml_data.'\',\''.
					  $fuseaction.'\',\''.
		              $v_staff_id.'\',\''. 
					  $v_recordtype_filter.'\',\''. 
					  $v_receive_date_filter.'\',\''. 
   					  $v_status_list.'\',\''.
					  $v_role.'\',\''.
					  $v_status_of_handover.'\',\''.
					  $v_status_of_assigning.'\',\''.
					  $v_status_of_handle_approve.'\',\''.
					  $v_status_of_chaiman_approve.'\',\''.
					  $v_order_clause.'\',\''.
					  $v_sort_type.'\',\''.
					  $v_detail_status_compare.'\',\''.
					  $v_page.'\',\''.
					  $v_limit_row.'\',\''.
					  $v_status_compare.'\',\''.
					  $v_values.'\',\''.
					  $v_name_ben_a.'\',\''.
					  $v_name_ben_b.'\',\''.
					  $v_handler_name.'\',\''.
					  $v_values_.'\',\''.
					  $v_values_record_id.'\',\''.
					  $_REQUEST['from_receive_date'].'\',\''.
					  $_REQUEST['to_receive_date'].'\',\''.
					  $_REQUEST['from_appointed_date'].'\',\''.
					  $_REQUEST['to_appointed_date'].'\',\''.
					  $_REQUEST['tu_ngay'].'\',\''.
					  $_REQUEST['den_ngay'].'\'); ">';	
	$v_html_temp_label = $v_html_temp_label  .$v_label;
	$v_html_temp_label = $v_html_temp_label  .$v_image .'</td>';
	$table_struct_rec = $table_struct_rax->readRecord();
	$v_id ++;
}
/************* end modified by tuyenntt ***************/
$v_html_string = $v_html_string  . $v_html_temp_width;
$v_html_string = $v_html_string  . '<tr class="header">';
$v_html_string = $v_html_string  . $v_html_temp_label;
$v_html_string = $v_html_string  . '</tr></table>';
$v_html_string = $v_html_string  . '<table class="list_table2" width="100%" cellpadding="0" cellspacing="0">';
$v_html_string = $v_html_string  . $v_html_temp_width;
$i = 0;		//nieuvv--281008------dat id cho tung cot
	if ($v_count >0){
		for($row_index = 0;$row_index< $v_count ;$row_index++){
			$v_url = "";
			$v_received_record_xml_data = $arr_all_record[$row_index]['C_RECEIVED_RECORD_XML_DATA'];
			//echo htmlspecialchars($v_received_record_xml_data);
			
			// begin--nieuvv--090708--lay so ngay thuc hien cua tung loai ho so				
			$v_limited_date = $arr_all_record[$row_index]['C_PROCESS_DATE'];		// so ngay thuc hien cua ho so
			$v_record_date = $arr_all_record[$row_index]['DATE_OF_PROCESS'];			// ngay con lai
			$v_recordtype = $arr_all_record[$row_index]['FK_RECORDTYPE'];
			$v_pk_record = $arr_all_record[$row_index]['PK_RECORD'];			
			$v_fk_dispute = $arr_all_record[$row_index]['TRANH_CHAP'];//ho so co tinh trang la 'TRANH_CHAP' trong cot TRANH_CHAP
			// the--end--nieuvv--090708----

			//DatCQ: Bo sung de hien thi NgayTrinhKi trong danh sach ho so cho Duyet 13/10/2008
			if($arr_all_record[$row_index]['NgayTrinhKy']!=''){
				$arr_all_record[$row_index]['NgayTrinhKy'] = Get_DMY($arr_all_record[$row_index]['NgayTrinhKy']);
			}
			//DatCQ: Bo sung de hien thi NgayTrinhKi trong danh sach ho so cho Duyet 13/10/2008
			
			if(sizeof($arr_report_date) > 0){
				$v_date_of_limited = intval($arr_report_date[1]['C_NAME']);
				$v_record_date_of_limited = intval($arr_report_date[0]['C_NAME']);			
			}
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";			
				}
			if($v_limited_date >= $v_date_of_limited){
				if($v_record_date <= $v_record_date_of_limited && $v_record_date >0){
					$v_current_style_name = "red_row";
				}
			}	
			//*********************NgocNTM__***************
			//Nhung ho so co tinh trang la dang tranh chao thi to mau vang o ca tiep nhan, thu ly va phe duyet
			if($v_fk_dispute == "TRANH_CHAP")
			{
				$v_current_style_name = "yellow_row";
			}
			//----------------------End__------------
			$v_html_string = $v_html_string  .'<tr class="'.$v_current_style_name.'" >'; 
			$table_struct_rax = new RAX(); 
			$table_struct_rec = new RAX(); 
			$table_struct_rax->open($v_table_struct_xml_string);		
			$table_struct_rax->record_delim = 'col';
			$table_struct_rax->parse();
			$table_struct_rec = $table_struct_rax->readRecord(); 
			
			while ($table_struct_rec) { 
				
				$table_struct_row = $table_struct_rec->getRow();
				$v_type = $table_struct_row["type"];
				$v_width = $table_struct_row["width"];
				$v_align = $table_struct_row["align"];
				$v_xml_data = $table_struct_row["xml_data"];
				$v_column_name = $table_struct_row["column_name"];
				//echo 'v_column_name'.$v_column_name.'<br>';
				$v_xml_tag_in_db = $table_struct_row["xml_tag_in_db"];
				$v_php_function = $table_struct_row["php_function"];
				$v_selectbox_option_sql = $table_struct_row["selectbox_option_sql"];			
				if ($v_xml_data=="true"){				
					$column_rax = new RAX(); 
					$column_rec = new RAX();
					$column_rax->open($v_received_record_xml_data);
					$column_rax->record_delim = 'data_list';
					$column_rax->parse();
					$column_rec = $column_rax->readRecord(); 
					$column_row = $column_rec->getRow();
					$v_value = _restore_XML_bad_char($column_row[$v_xml_tag_in_db]);
					$v_html_string = $v_html_string  . Element_Type($v_type);
					 $i++;//nieuvv--281008------dat id cho tung cot
				}else{
					$v_value = $arr_all_record[$row_index][$v_column_name];
					if ($v_type=="checkbox"){
						$v_value_id = $arr_all_record[$row_index][$v_column_name];
							if($v_recordtype_filter=="All"){
								$v_url = "row_onclick_all(" . "document.forms[0].hdn_record_id"  . "," . $v_value_id . "," . "'".$v_fuseaction_onclick."','" . $v_goto_url . "','".$arr_all_record[$row_index][FK_RECORDTYPE]."')";
							}
							else
								$v_url = "row_onclick(" . "document.forms[0].hdn_record_id"  . "," . $v_value_id . "," . "'".$v_fuseaction_onclick."','" . $v_goto_url . "')";
					}
					$v_html_string = $v_html_string  . Element_Type($v_type); 
					$i++;//nieuvv--281008------dat id cho tung cot
				}
				
				$table_struct_rec = $table_struct_rax->readRecord();					

			}
			$v_html_string = $v_html_string  .'</tr>';
		}
	}
	if ($v_current_style_name == "odd_row"){
		$v_next_style_name = "round_row";
	}else{
		$v_next_style_name = "odd_row";
	}
	// begin--nieuvv--090708-----
	if ($v_current_style_name == "red_row"){
		$v_current_style_name ="odd_row" ;
		$v_next_style_name = "round_row";
	}else{
		$v_next_style_name = "odd_row";
	}
	// the--end--nieuvv--090708-----
	//---------NgocNTM__----------------------------
	//To mau vang cho ho so co tinh trang la 'TRANH_CHAP'
	if ($v_current_style_name == "yellow_row"){
		$v_current_style_name ="odd_row" ;
		$v_next_style_name = "round_row";
	}else{
		$v_next_style_name = "odd_row";
	}
	//---------------------End__-----------------------
$v_html_string = $v_html_string  . _add_empty_row($v_count,_CONST_NUMBER_OF_ROW_PER_LIST,$v_current_style_name,$v_next_style_name,$v_column);
//$v_html_string = $v_html_string  .'</table></div>';
$v_html_string = $v_html_string  .'</table>';
//echo $v_html_string;
echo '<div id = "content">'.$v_html_string.'</div>';
?>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr><td height="5pt"></td></tr>
	<tr><?php
		if ($v_count>0){?>
			<td align="left" colspan = "2" class="small_label">
				<small class="small_starmark"><?php echo CONST_RECORD_COUNT_LIST_LABEL1 . $v_count . CONST_RECORD_COUNT_LIST_LABEL2;?></small>
			</td><?php
			if ($v_worktype!=""){?>
				<td class="normal_label" align="right">
					<input type="radio" name="rad_selectall" value="0" onClick="select_all_checkbox(document.forms[0],'chk_item_id');"><?php echo CONST_RECORD_SELECT_ALL_LABEL?>
					<input type="radio" name="rad_selectall" value="1" checked onClick="deselect_all(document.forms[0],'chk_item_id');"><?php echo CONST_RECORD_DESELECT_ALL_LABEL?>
				</td><?php
			}
		}else{?>
			<td align="left" colspan = "2" class="small_label">
				<small class="small_starmark"><?php echo CONST_RECORD_COUNT_LIST_LABEL;?></small>
			</td><?php
		}?>
	</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<col width="5%"><col width="95%">
	<tr>
		<td align="right" class="normal_link"><? 
			if ($v_count >0){
				echo onegate_pagebreak_selectbox($v_total_record,$v_page,$v_limit_row,$fuseaction) ."&nbsp;". onegate_change_record_number_page($v_limit_row,$fuseaction);
			}
			?>
		</td>
	</tr>
</table>
<!--Table chua cac button-->
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
	<tr><td height="5pt"></td></tr><?php
	if ($v_worktype=="TIEP_NHAN"){?>
	<tr>
		<td align="left" colspan="10"><?php 
			if ((($v_is_granted_update)|| (onegate_is_receiver_for_recordtype($v_receiver_id,0,$_SESSION["recordtype"])))&&$v_recordtype_filter!="All" ){ ?>
				<input type="button" value="<?php echo _CONST_ADD_BUTTON; ?>" name="btn_add" class="normal_button" onClick="btn_add_onclick(document.forms[0].hdn_record_id, 'DISPLAY_SINGLE_RECORD')"><?php
			}
			if ($v_count>0){
				if (($v_check_recordtype)  && (!$v_move_to_leader_status)) {?>
					<input type="button" value="<?php echo CONST_RECORD_RECEIPTED_PRINT_BUTTON; ?>" name="btn_add" style="width:20%" class="large_button" onClick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT');">
					<input type="button" value="<?php echo CONST_RECORD_RECEIPTED_LABEL_PRINT_BUTTON; ?>" name="btn_add" class="large_button" onClick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT_LABEL');">
					<?php 
				}?>
				<input type="button" value="<?php echo CONST_RECORD_RECEIPTED_HAND_BUTTON; ?>" name="btn_add" style="width:35%" class="large_button" onClick="show_modal_dialog_update_onclick('record/receive/index.php','DISPLAY_RECORD_HANDOVER','UPDATE_RECORD_HANDOVER',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_handler);"><?php 
				if (($v_check_recordtype) && (!$v_move_to_leader_status)) {?>
					<input type="button" value="<?php echo CONST_RECORD_TO_CHECK_PRINT_BUTTON; ?>" name="btn_add" style="width:20%" class="large_button" onClick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_HANDOVER');"><?php
				}
				if($v_move_to_leader_status){?>				
						<input type="button" value="<?php echo _CONST_MOVE_TO_LEADER; ?>" name="btn_add" class="large_button"  style=" width:40%" onClick="show_modal_dialog_update_onclick('record/receive/index.php','DISPLAY_LIST_RECORD_MOVE_TO_RESULT','UPDATE_RECORD_LIST_CHECKED',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter);">				
				<?php 
				}
				if($v_recordtype_filter == "030" || $v_recordtype_filter == "032")
				{?> 
					<input type="button" value="<?php echo _CONST_MOVE_LABEL; ?>" name="btn_move" style="width:35%" class="large_button" onClick="btn_move_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'UPDATE_LUANCHUYEN_HANDOVER','LUAN_CHUYEN');">
				<?php 
				}
				if (($v_is_granted_update) || ($v_delete_record > 0) ){?>
					<input type="button" value="<?php echo _CONST_DELETE_BUTTON; ?>" name="btn_delete" class="normal_button" onClick="btn_delete_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DELETE_RECORD')"><?php
				}
			}?>
		</td>
	</tr><?php
	}elseif($v_worktype=="TRINH_KY" && _CONST_ALLOW_HANDLER_UPDATING_APPROVING){?>
		<tr>
		<td align="left"><?php
			if($fuseaction=="DISPLAY_ALL_RECORD_FOR_APPROVING" && $v_count>0){?>
			<!--DatCQ: 141008 Button KN Danh Sach Ho So Cho Duyet (Phe Duyet)-->
				<input type="button" value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_result_handle" class="large_button" onClick="btn_result_handle_onclick( document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_PD_HSTK');"><?php } 
			if($fuseaction=="DISPLAY_ALL_WATING_NOTIFY_PUNISH" && $v_count>0){	?>
			<!--DatCQ: 141008 Button KN Danh Sach Ho So Phe Duyet Thong Bao Phat (Phe Duyet)-->	
				<input type="button" value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_result_handle" class="large_button" onClick="btn_result_handle_onclick( document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_PD_TBP');"><?php } 
			if($fuseaction=="DISPLAY_ALL_WATING_NOTIFY_TAX" && $v_count>0){	?>
			<!--DatCQ: 141008 Button KN Danh Sach Ho So Phe Duyet Thong Bao Thue (Phe Duyet)-->
				<input type="button" value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_result_handle" class="large_button" onClick="btn_result_handle_onclick( document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_PD_TBT');"><?php } 	
			if (($_ISA_CURRENT_MODUL_CODE== "HANDLE") && (onegate_is_handler_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"])==true)&&($v_count>0)){?>
				<input type="hidden" name="hdn_approve_by_handler" value="<?php echo true ?>">
				<input type="button" value="<?php echo CONST_RESULT_APPROVING_RECORD_BUTTON; ?>" name="btn_result_handle" class="large_button" onClick="btn_result_handle_onclick_hieudt(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_ALL_HANDLE_RECORD_FOR_UPDATE_STATUS')"><?php 
			}
			
			if (($_ISA_CURRENT_MODUL_CODE== "APPROVING")&&($v_count>0)){
				if (($fuseaction=="DISPLAY_ALL_WATING_NOTIFY_PUNISH" || $fuseaction=='DISPLAY_ALL_WATING_NO_NOTIFY_PUBNISH') && is_contain_config($v_c_system_conf,'TRINH_LDLC_TP')&& !is_leader_last($_SESSION['staff_id'],$v_arrs_leader_last_approve)){
				$v_temp_le='DISPLAY_NOTIFY_2';
				}
			?>
				
				<input type="hidden" name="hdn_approve_by_handler" value="<?php echo true ?>">
				<input type="button" value="<?php echo CONST_UPDATE_APPROVING_STATUS_BUTTON; ?>" name="btn_result_handle" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'<?php echo $v_temp_le;?>')"><?php  //Leav_update_end:31072008
			}?>
		</td>
	</tr><?php	
	}elseif (($v_worktype=="THU_LY" || $v_worktype=="NHAN_HO_SO_BO_SUNG" || $v_worktype=="CHUYEN_HOSO_CQTQ"||$v_worktype=="DANH_SACH_HS_THONG_BAO_THUE"||$v_worktype=="DANH_SACH_HS_THONG_BAO_PHAT")&&($v_count>0)){?>
	<tr>
		<td align="left" colspan="10">
			<input type="button"  value="<?php echo CONST_RATE_BUTTON; ?>" name="btn_rate" class="normal_button" onClick="btn_result_handle_onclick_kienlt(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK')">
			<input type="button"  value="<?php echo CONST_IDEA_BUTTON; ?>" name="btn_idea" class="normal_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_IDEA')">
			<input type="button"  value="<?php echo CONST_OPINION_BUTTON; ?>" name="btn_opinion" class="normal_button" style=" width:18%" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_DOC')">
			<?php if($v_worktype=="DANH_SACH_HS_THONG_BAO_PHAT"||$v_worktype=="DANH_SACH_HS_THONG_BAO_THUE"){
				if($v_worktype=="DANH_SACH_HS_THONG_BAO_PHAT"){
			?>
			<!--DatCQ: 141008 Button KN Danh Sach Ho So Thong Bao Phat (Thu Ly)-->
			<input type="button"  value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_opinion" class="normal_button" style=" width:18%" onClick="btn_result_handle_onclick (document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_TBP');">
			<input type="button"  value="<?php echo CONST_CONTENT_NOTIFY_PHAT; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick_leav(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_SINGLE_NOTIFY_PUNISH_CONTENT');">
 			<?php }
				else {
			?>
			<!--DatCQ: 141008 Button KN Danh Sach Ho So Thong Bao Thue (Thu Ly)-->
			<input type="button"  value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_opinion" class="normal_button" style=" width:18%" onClick="btn_result_handle_onclick (document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_TBT');">
			<input type="button"  value="<?php echo CONST_CONTENT_NOTIFY_THUE; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick_leav(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_SINGLE_NOTIFY_TAX_CONTENT');">
			<?php }			} ?>
			<!--Button :Thong Bao -->
			
			<?php 
			if ($v_size >=1 && $v_worktype=="THU_LY"&&$_ISA_CURRENT_MODUL_CODE=='HANDLE'){ ?>
               <input type="button"  value="<?php echo CONST_NOTIFY_THUE; ?>" name="btn_opinion" class="normal_button" style=" width:18%" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_NOTIFY')">
			
			<?php }
			if (($_ISA_CURRENT_MODUL_CODE== "HANDLE") && (onegate_is_handler_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"])==true)&&$v_recordtype_filter!="All"){?>
			<input type="button" value="<?php echo CONST_RESULT_HANDLE_RECORD_BUTTON; ?>" name="btn_result_handle" class="normal_button"  style=" width:15%" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_ALL_HANDLE_RECORD_FOR_UPDATE_STATUS')"><?php 
			}
			if ($v_worktype=="NHAN_HO_SO_BO_SUNG" && $_ISA_CURRENT_MODUL_CODE == "RECEIVE_RESULT"){?>
			<input type="button"  value="<?php echo _CONST_SEND_EMAIL_BUTTON; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_MULTIPLE_RECORD_FOR_SEND_MAIL')">
			<!--DatCQ: 141008 Button KN Danh Sach Ho So Cho Bo Sung (TN TKQ)-->
			<input type="button"  value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TN_CBS');">
			<?php }
			if (onegate_is_doc_with_multi_object_for_recordtype($v_recordtype_filter,$_SESSION['recordtype'])){?>
			<input type="button"  value="<?php echo $arr_result_label[3]; ?>" name="btn_update_license" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_MULTIPLE_LICENSE')"><?php
			}
			if ($_ISA_CURRENT_MODUL_CODE== "RECEIVE_RESULT" && $v_worktype=="THU_LY" && $v_fuseaction_onclick != "DISPLAY_ALL_RECORD_WORK_VUNH"){?>
			<input type="button" value="<?php echo CONST_RECORD_RECEIPTED_FORWORD_BUTTON; ?>" name="btn_add" style="width:20%" class="large_button" onClick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_HANDOVER');"><?php
			}
			//nut in phieu trinh ky
			if ($_ISA_CURRENT_MODUL_CODE== "HANDLE" && $v_worktype=="THU_LY" && ($v_check_recordtype)){?>
				<input type="button" value="<?php echo CONST_PRINT_TO_SUBMIT; ?>" name="btn_add" class="large_button" onClick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_TO_SUBMIT');">
				<!--DatCQ: 141008 Button KN Danh Sach Ho So Dang Thu Ly (Thu Ly)-->
				<input type="button" value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_add" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_HSDTL');">
			<?php }?>
		</td>
	</tr><?php	
	}elseif (($v_worktype=="PHAN_CONG")&&($v_count>0) ){?>
	<tr>
		<td align="left" colspan="10">			
			<input type="button"  value="<?php echo CONST_SHARING_RECORD_BUTTON; ?>" name="btn_sharing" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_SHARING_RECORD')">
		</td>
	</tr><?php	
	}elseif (($v_worktype=="THAY_DOI_NGUOI_THU_LY")&&($v_count>0) ){?>
		<tr>
		<td align="left" colspan="10">			
			<input type="button"  value="<?php echo CONST_SHARING_RECORD_CHANGLE_BUTTON; ?>" name="btn_sharing" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_SHARING_RECORD')">
		</td>
	</tr><?php	
	}elseif(($v_worktype=="CAP_PHEP" || $v_worktype=="TRINH_KY")&&($v_count>0) && onegate_is_doc_with_multi_object_for_recordtype($v_recordtype_filter,$_SESSION['recordtype'])){?>
	<tr>
		<td align="center" colspan="10">			
			<input type="button"  value="<?php echo $arr_result_label[3]; ?>" name="btn_update_license" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_MULTIPLE_LICENSE')">
		</td>
	</tr><?php
	}
	if (($v_count>0) && ($v_worktype=="TRA_KET_QUA")){?>
	<tr>
		<td align="left" colspan="10">			
			<input type="button"  value="<?php echo CONST_RESULT_BUTTON; ?>" name="btn_result" class="large_button" onClick="btn_result_update_onclick('DISPLAY_SINGLE_LICENCE_RECORD',document.forms[0].chk_item_id,document.forms[0].hdn_record_id)">
			<input type="button"  value="<?php echo _CONST_SEND_EMAIL_BUTTON; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,'DISPLAY_MULTIPLE_RECORD_FOR_SEND_MAIL')">
			<!--DatCQ: 141008 Button KN Danh Sach Ho So Tra Ket Qua (TN TKQ)-->	
			<input type="button"  value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_result_handle" class="large_button" onClick="btn_result_handle_onclick( document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_KQ_HSTKQ');">
		</td>
	</tr><?php }
	if($v_worktype == "NOTIFY_TAX_TU_CQUAN" ||$v_worktype == "NOTIFY_TAX" || $v_worktype == "NOTIFY_PHAT"){ 
	
	?>
	<tr>
		<td align="left" colspan="10">
		<?php if($v_worktype == "NOTIFY_TAX_TU_CQUAN"){ ?>
		<input  type="button"  value="<?php echo CONST_RECEIVE_NOTIFY_FROM_CQUAN; ?>" name="btn_send_mail" class="large_button" onclick="show_modal_dialog_update_onclick_nhan_blai_tu_cquan('record/receive/index.php','RECEIVE_BLAI_THUE_TU_CQUAN','UPDATE_RECEIVE_BLAI_THUE_TU_CQUAN',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_txt_result);">
	<?php }elseif($v_worktype == "NOTIFY_TAX"){
		$v_dsp_handover='DISPLAY_RECORD_HANDOVER_THUE';
		$v_update='UPDATE_RECORD_HANDOVER_THUE';
		$v_function_showdialog='show_modal_dialog_update_onclick_tax_2';
	 ?>
	<?php }else{
		$v_dsp_handover='DISPLAY_RECORD_HANDOVER_PHAT';
		$v_update='UPDATE_RECORD_HANDOVER_PHAT';
		$v_function_showdialog='show_modal_dialog_update_onclick_tax';
	}?>
	
	<input type="button"  value="<?php echo CONST_RECORD_RECEIPTED_PRINT_BUTTON; ?>" name="btn_send_mail" class="large_button" onClick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT');">
	<?php if($v_worktype == "NOTIFY_TAX" || $v_worktype == "NOTIFY_PHAT"){ ?>
	
	<input type="button"  value="<?php if($v_worktype == "NOTIFY_TAX"){ echo CONST_NOTIFY_TAX_LINK;}else{
	echo CONST_NOTIFY_PUNISH_LINK; } ?>" name="btn_send_mail" class="large_button" onClick="<?php echo $v_function_showdialog;?>('record/receive/index.php','<?php echo $v_dsp_handover;?>','<?php echo $v_update;?>',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_tax_receiver,document.forms[0].hdn_txt_result<?php if($v_worktype == "NOTIFY_TAX"){?>,document.forms[0].hdn_txt_date_notify_tu_cquan,document.forms[0].hdn_receiver_notify_name <?php }?>);">
	<?php }?>
	<input type="button"  value="<?php echo CONST_TIEN_DO; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK_VUNH');">
	<input type="button"  value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TN_TBT');">
		</td>
	</tr>
	<?php }?>
	<!--Hien thi cac button :Form Danh Sach HS cho nhan bien lai thue-phat -->
	<?php if($v_worktype == "DANH_SACH_HS_DA_NOP_THUE" || $v_worktype == "DANH_SACH_HS_DA_NOP_PHAT"){ ?>
	<input type="button"  value="<?php echo CONST_RECORD_RECEIPTED_PRINT_BUTTON; ?>" name="btn_send_mail" class="large_button" onClick="show_window_to_print('index.php',document.forms[0].chk_item_id,'<?php echo $v_recordtype_filter;?>','PRINT_RECORD_RECEIPT');">
	<input type="button" value="<?php echo CONST_RECORD_RECEIPTED_HAND_BUTTON; ?>" name="btn_add" style="width:35%" class="large_button" onClick="show_modal_dialog_update_onclick('record/receive/index.php','DISPLAY_RECORD_HANDOVER_PHAT','<?php echo $v_update;?>',document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list,document.forms[0].hdn_recordtype_filter,document.forms[0].hdn_received_date_filter,document.forms[0].hdn_handler);">
	<input type="button"  value="<?php echo CONST_TIEN_DO; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id,document.forms[0].hdn_record_id,'DISPLAY_ALL_RECORD_WORK_VUNH');">
	<?php }?>
	<?php 
	if($fuseaction== 'DISPLAY_ALL_RECORD_APPROVED'&& $v_worktype == "CAP_PHEP"){ ?>
	<input type="button"  value="<?php echo _CONST_KYNHAN_BUTTON; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SIGN_RECEIPT_RECORD_NHSG_TL_HSDGQ');">
	<?php if($_work_leav !=1001 && $_work_leav !=1000  && $_SESSION['onegate_current_recordtype'] != "All"){?>	
		<input type="button"  value="<?php echo $arr_result_label[3]; ?>" name="btn_send_mail" class="large_button" onClick="btn_result_handle_onclick(document.forms[0].chk_item_id, document.forms[0].hdn_record_id, 'DISPLAY_SINGLE_LICENSE', document.forms[0].hdn_recordtype_filter);">		
	<?php }
	 }?>
</table>
</div id="hotkey">
</form> 
<script>
	document.all.goto.href="#<? echo $v_current_item_id;?>";
	document.all.goto.click();
</script>
<?php 
	if ($_ISA_CURRENT_MODUL_CODE == "HANDLE" || $_ISA_CURRENT_MODUL_CODE == "APPROVING" || $_ISA_CURRENT_MODUL_CODE == "RECEIVE_RESULT" ) {
?>
<script>	
	function a() {
	<?php 
	$array_a_b = array('010','027','035','036','037','038','039','040','041');
	if(in_array($v_recordtype_filter,$array_a_b)){ ?>
	document.forms(0).ben_a.value='<? echo $v_name_ben_a;?>';
	document.forms(0).ben_b.value='<? echo $v_name_ben_b;?>';
	<?php } else { ?>
	document.forms(0).ho_ten.value='<? echo $v_values;?>';
	<?php } ?>
	document.forms(0).record_id_search.value='<? echo $v_values_record_id;?>';		// nieuvv--160908--gan gia tri mac dinh cho textbox Ma ho so

	document.forms(0).from_receive_date.value='<? echo _yyyymmdd_to_ddmmyyyy($v_from_receive_date);?>';	 	//datcq--300908
	document.forms(0).to_receive_date.value='<? echo _yyyymmdd_to_ddmmyyyy($v_to_receive_date);?>';			//datcq--300908
	document.forms(0).from_appointed_date.value='<? echo _yyyymmdd_to_ddmmyyyy($v_from_result_date);?>';	//datcq--300908
	document.forms(0).to_appointed_date.value='<? echo _yyyymmdd_to_ddmmyyyy($v_to_result_date);?>';		//datcq--300908
	
	<?php if($_ISA_CURRENT_MODUL_CODE == "APPROVING") { ?>
	document.forms(0).can_bo_thu_ly.value='<? echo $v_handler_name;?>';	//datcq--160908
	<?php } ?>	
}
	a();
</script>
<?php } 
//if (!$is_sort) {
	echo '<!--dung cho sort (khong duoc xoa hay hieu chinh dong comment nay)--></div>';
//}	
?>
